.class final Lcom/burstly/lib/ui/BurstlyViewQueueListener;
.super Ljava/lang/Object;
.source "BurstlyViewQueueListener.java"

# interfaces
.implements Lcom/burstly/lib/component/ComponentQueue$IQueueComponentListener;


# instance fields
.field private final mBview:Ljava/lang/ref/Reference;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ref/Reference",
            "<",
            "Lcom/burstly/lib/ui/BurstlyView;",
            ">;"
        }
    .end annotation
.end field

.field private final mPrecacheRequest:Z


# direct methods
.method constructor <init>(Lcom/burstly/lib/ui/BurstlyView;)V
    .locals 1
    .parameter "bView"

    .prologue
    .line 47
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 48
    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mBview:Ljava/lang/ref/Reference;

    .line 49
    invoke-virtual {p1}, Lcom/burstly/lib/ui/BurstlyView;->isPrecacheRequest()Z

    move-result v0

    iput-boolean v0, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mPrecacheRequest:Z

    .line 50
    return-void
.end method


# virtual methods
.method public componentChanged(Lcom/burstly/lib/component/IAdaptorController;)V
    .locals 2
    .parameter "newComponent"

    .prologue
    .line 76
    iget-object v1, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mBview:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 77
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_0

    .line 82
    :goto_0
    return-void

    .line 80
    :cond_0
    iget-boolean v1, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mPrecacheRequest:Z

    invoke-interface {p1, v1}, Lcom/burstly/lib/component/IAdaptorController;->setPrefetchedRequest(Z)V

    .line 81
    invoke-virtual {v0, p1}, Lcom/burstly/lib/ui/BurstlyView;->setActiveController(Lcom/burstly/lib/component/IAdaptorController;)V

    goto :goto_0
.end method

.method public rerequestServer()V
    .locals 2

    .prologue
    .line 54
    iget-object v1, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mBview:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 55
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_1

    .line 61
    :cond_0
    :goto_0
    return-void

    .line 58
    :cond_1
    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->isDestroyed()Z

    move-result v1

    if-nez v1, :cond_0

    .line 59
    iget-boolean v1, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mPrecacheRequest:Z

    invoke-virtual {v0, v1}, Lcom/burstly/lib/ui/BurstlyView;->restartRequest(Z)V

    goto :goto_0
.end method

.method public scheduleRequest(I)V
    .locals 2
    .parameter "newSessionLength"

    .prologue
    .line 65
    iget-object v1, p0, Lcom/burstly/lib/ui/BurstlyViewQueueListener;->mBview:Ljava/lang/ref/Reference;

    invoke-virtual {v1}, Ljava/lang/ref/Reference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/burstly/lib/ui/BurstlyView;

    .line 66
    .local v0, bView:Lcom/burstly/lib/ui/BurstlyView;
    if-nez v0, :cond_1

    .line 72
    :cond_0
    :goto_0
    return-void

    .line 69
    :cond_1
    invoke-virtual {v0}, Lcom/burstly/lib/ui/BurstlyView;->isDestroyed()Z

    move-result v1

    if-nez v1, :cond_0

    .line 70
    mul-int/lit16 v1, p1, 0x3e8

    invoke-virtual {v0, v1}, Lcom/burstly/lib/ui/BurstlyView;->setServerSideRefreshInterval(I)V

    goto :goto_0
.end method
